package com.yunianvh.webrtc_compose_demo.net

import com.drake.net.NetConfig
import com.drake.net.okhttp.trustSSLCertificate
import com.yunianvh.webrtc_compose_demo.net.bean.GsonConverter

/**
 * Created by 玉念聿辉.
 * Use: 网络
 * Date: 2023/1/2
 * Time: 17:18
 */
class NetUtil private constructor() {
    private val TAG = NetUtil::class.java.simpleName

    companion object {
        val instance by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
            NetUtil()
        }
    }

    fun init() {
        NetConfig.logEnabled = false
        NetConfig.converter = GsonConverter()
        NetConfig.init("https://192.168.1.172") {
            trustSSLCertificate()
        }
    }
}